<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>GDBusError</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GIO Reference Manual">
<link rel="up" href="gdbus-lowlevel.html" title="Lowlevel D-Bus Support">
<link rel="prev" href="gio-D-Bus-Introspection-Data.html" title="D-Bus Introspection Data">
<link rel="next" href="GDBusMessage.html" title="GDBusMessage">
<meta name="generator" content="GTK-Doc V1.17 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gio-D-Bus-Introspection-Data.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="gdbus-lowlevel.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GIO Reference Manual</th>
<td><a accesskey="n" href="GDBusMessage.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#GDBusError.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#GDBusError.description" class="shortcut">Description</a>
                   | 
                  <a href="#GDBusError.object-hierarchy" class="shortcut">Object Hierarchy</a>
</td></tr>
</table>
<div class="refentry">
<a name="GDBusError"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="GDBusError.top_of_page"></a>GDBusError</span></h2>
<p>GDBusError — Mapping D-Bus errors to and from GError</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="GDBusError.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gio/gio.h&gt;

enum                <a class="link" href="GDBusError.html" title="GDBusError">GDBusError</a>;
#define             <a class="link" href="GDBusError.html#G-DBUS-ERROR:CAPS" title="G_DBUS_ERROR">G_DBUS_ERROR</a>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GDBusError.html#g-dbus-error-is-remote-error" title="g_dbus_error_is_remote_error ()">g_dbus_error_is_remote_error</a>        (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *             <a class="link" href="GDBusError.html#g-dbus-error-get-remote-error" title="g_dbus_error_get_remote_error ()">g_dbus_error_get_remote_error</a>       (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GDBusError.html#g-dbus-error-strip-remote-error" title="g_dbus_error_strip_remote_error ()">g_dbus_error_strip_remote_error</a>     (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);
                    <a class="link" href="GDBusError.html#GDBusErrorEntry" title="GDBusErrorEntry">GDBusErrorEntry</a>;
<span class="returnvalue">void</span>                <a class="link" href="GDBusError.html#g-dbus-error-register-error-domain" title="g_dbus_error_register_error_domain ()">g_dbus_error_register_error_domain</a>  (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *error_domain_quark_name</code></em>,
                                                         <em class="parameter"><code>volatile <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *quark_volatile</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="GDBusError.html#GDBusErrorEntry" title="GDBusErrorEntry"><span class="type">GDBusErrorEntry</span></a> *entries</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> num_entries</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GDBusError.html#g-dbus-error-register-error" title="g_dbus_error_register_error ()">g_dbus_error_register_error</a>         (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> error_domain</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> error_code</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dbus_error_name</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            <a class="link" href="GDBusError.html#g-dbus-error-unregister-error" title="g_dbus_error_unregister_error ()">g_dbus_error_unregister_error</a>       (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> error_domain</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> error_code</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dbus_error_name</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a> *            <a class="link" href="GDBusError.html#g-dbus-error-new-for-dbus-error" title="g_dbus_error_new_for_dbus_error ()">g_dbus_error_new_for_dbus_error</a>     (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dbus_error_name</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dbus_error_message</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="GDBusError.html#g-dbus-error-set-dbus-error" title="g_dbus_error_set_dbus_error ()">g_dbus_error_set_dbus_error</a>         (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dbus_error_name</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dbus_error_message</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *format</code></em>,
                                                         <em class="parameter"><code>...</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="GDBusError.html#g-dbus-error-set-dbus-error-valist" title="g_dbus_error_set_dbus_error_valist ()">g_dbus_error_set_dbus_error_valist</a>  (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dbus_error_name</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dbus_error_message</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *format</code></em>,
                                                         <em class="parameter"><code><span class="type">va_list</span> var_args</code></em>);
<a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *             <a class="link" href="GDBusError.html#g-dbus-error-encode-gerror" title="g_dbus_error_encode_gerror ()">g_dbus_error_encode_gerror</a>          (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="GDBusError.object-hierarchy"></a><h2>Object Hierarchy</h2>
<pre class="synopsis">
  GEnum
   +----GDBusError
</pre>
</div>
<div class="refsect1">
<a name="GDBusError.description"></a><h2>Description</h2>
<p>
All facilities that return errors from remote methods (such as
<a class="link" href="GDBusConnection.html#g-dbus-connection-call-sync" title="g_dbus_connection_call_sync ()"><code class="function">g_dbus_connection_call_sync()</code></a>) use <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> to represent both D-Bus
errors (e.g. errors returned from the other peer) and locally
in-process generated errors.
</p>
<p>
To check if a returned <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> is an error from a remote peer, use
<a class="link" href="GDBusError.html#g-dbus-error-is-remote-error" title="g_dbus_error_is_remote_error ()"><code class="function">g_dbus_error_is_remote_error()</code></a>. To get the actual D-Bus error name,
use <a class="link" href="GDBusError.html#g-dbus-error-get-remote-error" title="g_dbus_error_get_remote_error ()"><code class="function">g_dbus_error_get_remote_error()</code></a>. Before presenting an error,
always use <a class="link" href="GDBusError.html#g-dbus-error-strip-remote-error" title="g_dbus_error_strip_remote_error ()"><code class="function">g_dbus_error_strip_remote_error()</code></a>.
</p>
<p>
In addition, facilities used to return errors to a remote peer also
use <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>. See <a class="link" href="GDBusMethodInvocation.html#g-dbus-method-invocation-return-error" title="g_dbus_method_invocation_return_error ()"><code class="function">g_dbus_method_invocation_return_error()</code></a> for
discussion about how the D-Bus error name is set.
</p>
<p>
Applications can associate a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> error domain with a set of D-Bus errors in order to
automatically map from D-Bus errors to <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> and back. This
is typically done in the function returning the <a href="http://library.gnome.org/devel/glib/unstable/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> for the
error domain:
</p>
<div class="example">
<a name="error-registration"></a><p class="title"><b>Example 1. Error Registration</b></p>
<div class="example-contents">
  <table class="listing_frame" border="0" cellpadding="0" cellspacing="0">
    <tbody>
      <tr>
        <td class="listing_lines" align="right"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32</pre></td>
        <td class="listing_code"><pre class="programlisting"><span class="comment">/* foo-bar-error.h: */</span>

<span class="preproc">#define</span><span class="normal"> </span><span class="function">FOO_BAR_ERROR</span><span class="normal"> </span><span class="symbol">(</span><span class="function">foo_bar_error_quark</span><span class="normal"> </span><span class="symbol">())</span>
<span class="usertype">GQuark</span><span class="normal"> </span><span class="function">foo_bar_error_quark</span><span class="normal"> </span><span class="symbol">(</span><span class="type">void</span><span class="symbol">);</span>

<span class="keyword">typedef</span><span class="normal"> </span><span class="keyword">enum</span>
<span class="cbracket">{</span>
<span class="normal">  FOO_BAR_ERROR_FAILED</span><span class="symbol">,</span>
<span class="normal">  FOO_BAR_ERROR_ANOTHER_ERROR</span><span class="symbol">,</span>
<span class="normal">  FOO_BAR_ERROR_SOME_THIRD_ERROR</span><span class="symbol">,</span>
<span class="cbracket">}</span><span class="normal"> FooBarError</span><span class="symbol">;</span>

<span class="comment">/* foo-bar-error.c: */</span>

<span class="keyword">static</span><span class="normal"> </span><span class="keyword">const</span><span class="normal"> </span><span class="usertype">GDBusErrorEntry</span><span class="normal"> foo_bar_error_entries</span><span class="symbol">[]</span><span class="normal"> </span><span class="symbol">=</span>
<span class="cbracket">{</span>
<span class="normal">  </span><span class="cbracket">{</span><span class="normal">FOO_BAR_ERROR_FAILED</span><span class="symbol">,</span><span class="normal">           </span><span class="string">"org.project.Foo.Bar.Error.Failed"</span><span class="cbracket">}</span><span class="symbol">,</span>
<span class="normal">  </span><span class="cbracket">{</span><span class="normal">FOO_BAR_ERROR_ANOTHER_ERROR</span><span class="symbol">,</span><span class="normal">    </span><span class="string">"org.project.Foo.Bar.Error.AnotherError"</span><span class="cbracket">}</span><span class="symbol">,</span>
<span class="normal">  </span><span class="cbracket">{</span><span class="normal">FOO_BAR_ERROR_SOME_THIRD_ERROR</span><span class="symbol">,</span><span class="normal"> </span><span class="string">"org.project.Foo.Bar.Error.SomeThirdError"</span><span class="cbracket">}</span><span class="symbol">,</span>
<span class="cbracket">}</span><span class="symbol">;</span>

<span class="normal"><a href="http://library.gnome.org/devel/glib/unstable/glib-Quarks.html#GQuark">GQuark</a></span>
<span class="function">foo_bar_error_quark</span><span class="normal"> </span><span class="symbol">(</span><span class="type">void</span><span class="symbol">)</span>
<span class="cbracket">{</span>
<span class="normal">  </span><span class="keyword">static</span><span class="normal"> </span><span class="keyword">volatile</span><span class="normal"> </span><span class="usertype">gsize</span><span class="normal"> quark_volatile </span><span class="symbol">=</span><span class="normal"> </span><span class="number">0</span><span class="symbol">;</span>
<span class="normal">  </span><span class="function"><a href="GDBusError.html#g-dbus-error-register-error-domain">g_dbus_error_register_error_domain</a></span><span class="normal"> </span><span class="symbol">(</span><span class="string">"foo-bar-error-quark"</span><span class="symbol">,</span>
<span class="normal">                                      </span><span class="symbol">&amp;</span><span class="normal">quark_volatile</span><span class="symbol">,</span>
<span class="normal">                                      foo_bar_error_entries</span><span class="symbol">,</span>
<span class="normal">                                      </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Miscellaneous-Macros.html#G-N-ELEMENTS:CAPS">G_N_ELEMENTS</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">foo_bar_error_entries</span><span class="symbol">));</span>
<span class="normal">  </span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Miscellaneous-Macros.html#G-STATIC-ASSERT:CAPS">G_STATIC_ASSERT</a></span><span class="normal"> </span><span class="symbol">(</span><span class="function"><a href="http://library.gnome.org/devel/glib/unstable/glib-Miscellaneous-Macros.html#G-N-ELEMENTS:CAPS">G_N_ELEMENTS</a></span><span class="normal"> </span><span class="symbol">(</span><span class="normal">foo_bar_error_entries</span><span class="symbol">)</span><span class="normal"> </span><span class="symbol">-</span><span class="normal"> </span><span class="number">1</span><span class="normal"> </span><span class="symbol">==</span><span class="normal"> FOO_BAR_ERROR_SOME_THIRD_ERROR</span><span class="symbol">);</span>
<span class="normal">  </span><span class="keyword">return</span><span class="normal"> </span><span class="symbol">(</span><span class="normal"><a href="http://library.gnome.org/devel/glib/unstable/glib-Quarks.html#GQuark">GQuark</a></span><span class="symbol">)</span><span class="normal"> quark_volatile</span><span class="symbol">;</span>
<span class="cbracket">}</span></pre></td>
      </tr>
    </tbody>
  </table>
</div>

</div>
<p><br class="example-break">
With this setup, a D-Bus peer can transparently pass e.g. <code class="literal">FOO_BAR_ERROR_ANOTHER_ERROR</code> and
other peers will see the D-Bus error name <code class="literal">org.project.Foo.Bar.Error.AnotherError</code>.
If the other peer is using GDBus, the peer will see also <code class="literal">FOO_BAR_ERROR_ANOTHER_ERROR</code> instead
of <a class="link" href="gio-GIOError.html#G-IO-ERROR-DBUS-ERROR:CAPS"><code class="literal">G_IO_ERROR_DBUS_ERROR</code></a>. Note that GDBus clients can still recover
<code class="literal">org.project.Foo.Bar.Error.AnotherError</code> using <a class="link" href="GDBusError.html#g-dbus-error-get-remote-error" title="g_dbus_error_get_remote_error ()"><code class="function">g_dbus_error_get_remote_error()</code></a>.
</p>
<p>
Note that errors in the <a class="link" href="GDBusError.html#G-DBUS-ERROR:CAPS" title="G_DBUS_ERROR"><code class="literal">G_DBUS_ERROR</code></a> error domain is intended only
for returning errors from a remote message bus process. Errors
generated locally in-process by e.g. <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> is from the
<a class="link" href="gio-GIOError.html#G-IO-ERROR:CAPS" title="G_IO_ERROR"><code class="literal">G_IO_ERROR</code></a> domain.
</p>
</div>
<div class="refsect1">
<a name="GDBusError.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="GDBusError"></a><h3>enum GDBusError</h3>
<pre class="programlisting">typedef enum
{
  /* Well-known errors in the org.freedesktop.DBus.Error namespace */
  G_DBUS_ERROR_FAILED,                           /* org.freedesktop.DBus.Error.Failed */
  G_DBUS_ERROR_NO_MEMORY,                        /* org.freedesktop.DBus.Error.NoMemory */
  G_DBUS_ERROR_SERVICE_UNKNOWN,                  /* org.freedesktop.DBus.Error.ServiceUnknown */
  G_DBUS_ERROR_NAME_HAS_NO_OWNER,                /* org.freedesktop.DBus.Error.NameHasNoOwner */
  G_DBUS_ERROR_NO_REPLY,                         /* org.freedesktop.DBus.Error.NoReply */
  G_DBUS_ERROR_IO_ERROR,                         /* org.freedesktop.DBus.Error.IOError */
  G_DBUS_ERROR_BAD_ADDRESS,                      /* org.freedesktop.DBus.Error.BadAddress */
  G_DBUS_ERROR_NOT_SUPPORTED,                    /* org.freedesktop.DBus.Error.NotSupported */
  G_DBUS_ERROR_LIMITS_EXCEEDED,                  /* org.freedesktop.DBus.Error.LimitsExceeded */
  G_DBUS_ERROR_ACCESS_DENIED,                    /* org.freedesktop.DBus.Error.AccessDenied */
  G_DBUS_ERROR_AUTH_FAILED,                      /* org.freedesktop.DBus.Error.AuthFailed */
  G_DBUS_ERROR_NO_SERVER,                        /* org.freedesktop.DBus.Error.NoServer */
  G_DBUS_ERROR_TIMEOUT,                          /* org.freedesktop.DBus.Error.Timeout */
  G_DBUS_ERROR_NO_NETWORK,                       /* org.freedesktop.DBus.Error.NoNetwork */
  G_DBUS_ERROR_ADDRESS_IN_USE,                   /* org.freedesktop.DBus.Error.AddressInUse */
  G_DBUS_ERROR_DISCONNECTED,                     /* org.freedesktop.DBus.Error.Disconnected */
  G_DBUS_ERROR_INVALID_ARGS,                     /* org.freedesktop.DBus.Error.InvalidArgs */
  G_DBUS_ERROR_FILE_NOT_FOUND,                   /* org.freedesktop.DBus.Error.FileNotFound */
  G_DBUS_ERROR_FILE_EXISTS,                      /* org.freedesktop.DBus.Error.FileExists */
  G_DBUS_ERROR_UNKNOWN_METHOD,                   /* org.freedesktop.DBus.Error.UnknownMethod */
  G_DBUS_ERROR_TIMED_OUT,                        /* org.freedesktop.DBus.Error.TimedOut */
  G_DBUS_ERROR_MATCH_RULE_NOT_FOUND,             /* org.freedesktop.DBus.Error.MatchRuleNotFound */
  G_DBUS_ERROR_MATCH_RULE_INVALID,               /* org.freedesktop.DBus.Error.MatchRuleInvalid */
  G_DBUS_ERROR_SPAWN_EXEC_FAILED,                /* org.freedesktop.DBus.Error.Spawn.ExecFailed */
  G_DBUS_ERROR_SPAWN_FORK_FAILED,                /* org.freedesktop.DBus.Error.Spawn.ForkFailed */
  G_DBUS_ERROR_SPAWN_CHILD_EXITED,               /* org.freedesktop.DBus.Error.Spawn.ChildExited */
  G_DBUS_ERROR_SPAWN_CHILD_SIGNALED,             /* org.freedesktop.DBus.Error.Spawn.ChildSignaled */
  G_DBUS_ERROR_SPAWN_FAILED,                     /* org.freedesktop.DBus.Error.Spawn.Failed */
  G_DBUS_ERROR_SPAWN_SETUP_FAILED,               /* org.freedesktop.DBus.Error.Spawn.FailedToSetup */
  G_DBUS_ERROR_SPAWN_CONFIG_INVALID,             /* org.freedesktop.DBus.Error.Spawn.ConfigInvalid */
  G_DBUS_ERROR_SPAWN_SERVICE_INVALID,            /* org.freedesktop.DBus.Error.Spawn.ServiceNotValid */
  G_DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND,          /* org.freedesktop.DBus.Error.Spawn.ServiceNotFound */
  G_DBUS_ERROR_SPAWN_PERMISSIONS_INVALID,        /* org.freedesktop.DBus.Error.Spawn.PermissionsInvalid */
  G_DBUS_ERROR_SPAWN_FILE_INVALID,               /* org.freedesktop.DBus.Error.Spawn.FileInvalid */
  G_DBUS_ERROR_SPAWN_NO_MEMORY,                  /* org.freedesktop.DBus.Error.Spawn.NoMemory */
  G_DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN,          /* org.freedesktop.DBus.Error.UnixProcessIdUnknown */
  G_DBUS_ERROR_INVALID_SIGNATURE,                /* org.freedesktop.DBus.Error.InvalidSignature */
  G_DBUS_ERROR_INVALID_FILE_CONTENT,             /* org.freedesktop.DBus.Error.InvalidFileContent */
  G_DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN, /* org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown */
  G_DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN,           /* org.freedesktop.DBus.Error.AdtAuditDataUnknown */
  G_DBUS_ERROR_OBJECT_PATH_IN_USE                /* org.freedesktop.DBus.Error.ObjectPathInUse */
} GDBusError;
</pre>
<p>
Error codes for the <a class="link" href="GDBusError.html#G-DBUS-ERROR:CAPS" title="G_DBUS_ERROR"><code class="literal">G_DBUS_ERROR</code></a> error domain.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><a name="G-DBUS-ERROR-FAILED:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_FAILED</code></span></p></td>
<td>A generic error; "something went wrong" - see the error message for
more.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-NO-MEMORY:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_NO_MEMORY</code></span></p></td>
<td>There was not enough memory to complete an operation.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-SERVICE-UNKNOWN:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_SERVICE_UNKNOWN</code></span></p></td>
<td>The bus doesn't know how to launch a service to supply the bus name
you wanted.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-NAME-HAS-NO-OWNER:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_NAME_HAS_NO_OWNER</code></span></p></td>
<td>The bus name you referenced doesn't exist (i.e. no application owns
it).
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-NO-REPLY:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_NO_REPLY</code></span></p></td>
<td>No reply to a message expecting one, usually means a timeout occurred.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-IO-ERROR:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_IO_ERROR</code></span></p></td>
<td>Something went wrong reading or writing to a socket, for example.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-BAD-ADDRESS:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_BAD_ADDRESS</code></span></p></td>
<td>A D-Bus bus address was malformed.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-NOT-SUPPORTED:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_NOT_SUPPORTED</code></span></p></td>
<td>Requested operation isn't supported (like ENOSYS on UNIX).
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-LIMITS-EXCEEDED:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_LIMITS_EXCEEDED</code></span></p></td>
<td>Some limited resource is exhausted.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-ACCESS-DENIED:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_ACCESS_DENIED</code></span></p></td>
<td>Security restrictions don't allow doing what you're trying to do.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-AUTH-FAILED:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_AUTH_FAILED</code></span></p></td>
<td>Authentication didn't work.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-NO-SERVER:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_NO_SERVER</code></span></p></td>
<td>Unable to connect to server (probably caused by ECONNREFUSED on a
socket).
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-TIMEOUT:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_TIMEOUT</code></span></p></td>
<td>Certain timeout errors, possibly ETIMEDOUT on a socket.  Note that
<a class="link" href="GDBusError.html#G-DBUS-ERROR-NO-REPLY:CAPS"><code class="literal">G_DBUS_ERROR_NO_REPLY</code></a> is used for message reply timeouts. Warning:
this is confusingly-named given that <a class="link" href="GDBusError.html#G-DBUS-ERROR-TIMED-OUT:CAPS"><code class="literal">G_DBUS_ERROR_TIMED_OUT</code></a> also
exists. We can't fix it for compatibility reasons so just be
careful.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-NO-NETWORK:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_NO_NETWORK</code></span></p></td>
<td>No network access (probably ENETUNREACH on a socket).
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-ADDRESS-IN-USE:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_ADDRESS_IN_USE</code></span></p></td>
<td>Can't bind a socket since its address is in use (i.e. EADDRINUSE).
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-DISCONNECTED:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_DISCONNECTED</code></span></p></td>
<td>The connection is disconnected and you're trying to use it.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-INVALID-ARGS:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_INVALID_ARGS</code></span></p></td>
<td>Invalid arguments passed to a method call.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-FILE-NOT-FOUND:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_FILE_NOT_FOUND</code></span></p></td>
<td>Missing file.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-FILE-EXISTS:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_FILE_EXISTS</code></span></p></td>
<td>Existing file and the operation you're using does not silently overwrite.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-UNKNOWN-METHOD:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_UNKNOWN_METHOD</code></span></p></td>
<td>Method name you invoked isn't known by the object you invoked it on.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-TIMED-OUT:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_TIMED_OUT</code></span></p></td>
<td>Certain timeout errors, e.g. while starting a service. Warning: this is
confusingly-named given that <a class="link" href="GDBusError.html#G-DBUS-ERROR-TIMEOUT:CAPS"><code class="literal">G_DBUS_ERROR_TIMEOUT</code></a> also exists. We
can't fix it for compatibility reasons so just be careful.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-MATCH-RULE-NOT-FOUND:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_MATCH_RULE_NOT_FOUND</code></span></p></td>
<td>Tried to remove or modify a match rule that didn't exist.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-MATCH-RULE-INVALID:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_MATCH_RULE_INVALID</code></span></p></td>
<td>The match rule isn't syntactically valid.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-SPAWN-EXEC-FAILED:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_SPAWN_EXEC_FAILED</code></span></p></td>
<td>While starting a new process, the <code class="function">exec()</code> call failed.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-SPAWN-FORK-FAILED:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_SPAWN_FORK_FAILED</code></span></p></td>
<td>While starting a new process, the <code class="function">fork()</code> call failed.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-SPAWN-CHILD-EXITED:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_SPAWN_CHILD_EXITED</code></span></p></td>
<td>While starting a new process, the child exited with a status code.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-SPAWN-CHILD-SIGNALED:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_SPAWN_CHILD_SIGNALED</code></span></p></td>
<td>While starting a new process, the child exited on a signal.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-SPAWN-FAILED:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_SPAWN_FAILED</code></span></p></td>
<td>While starting a new process, something went wrong.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-SPAWN-SETUP-FAILED:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_SPAWN_SETUP_FAILED</code></span></p></td>
<td>We failed to setup the environment correctly.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-SPAWN-CONFIG-INVALID:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_SPAWN_CONFIG_INVALID</code></span></p></td>
<td>We failed to setup the config parser correctly.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-SPAWN-SERVICE-INVALID:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_SPAWN_SERVICE_INVALID</code></span></p></td>
<td>Bus name was not valid.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-SPAWN-SERVICE-NOT-FOUND:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND</code></span></p></td>
<td>Service file not found in system-services directory.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-SPAWN-PERMISSIONS-INVALID:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_SPAWN_PERMISSIONS_INVALID</code></span></p></td>
<td>Permissions are incorrect on the setuid helper.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-SPAWN-FILE-INVALID:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_SPAWN_FILE_INVALID</code></span></p></td>
<td>Service file invalid (Name, User or Exec missing).
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-SPAWN-NO-MEMORY:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_SPAWN_NO_MEMORY</code></span></p></td>
<td>Tried to get a UNIX process ID and it wasn't available.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-UNIX-PROCESS-ID-UNKNOWN:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN</code></span></p></td>
<td>Tried to get a UNIX process ID and it wasn't available.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-INVALID-SIGNATURE:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_INVALID_SIGNATURE</code></span></p></td>
<td>A type signature is not valid.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-INVALID-FILE-CONTENT:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_INVALID_FILE_CONTENT</code></span></p></td>
<td>A file contains invalid syntax or is otherwise broken.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-SELINUX-SECURITY-CONTEXT-UNKNOWN:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN</code></span></p></td>
<td>Asked for SELinux security context and it wasn't available.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-ADT-AUDIT-DATA-UNKNOWN:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN</code></span></p></td>
<td>Asked for ADT audit data and it wasn't available.
</td>
</tr>
<tr>
<td><p><a name="G-DBUS-ERROR-OBJECT-PATH-IN-USE:CAPS"></a><span class="term"><code class="literal">G_DBUS_ERROR_OBJECT_PATH_IN_USE</code></span></p></td>
<td>There's already an object with the requested object path.
</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="G-DBUS-ERROR:CAPS"></a><h3>G_DBUS_ERROR</h3>
<pre class="programlisting">#define G_DBUS_ERROR g_dbus_error_quark()
</pre>
<p>
Error domain for errors generated by a remote message bus. Errors
in this domain will be from the <a class="link" href="GDBusError.html" title="GDBusError"><span class="type">GDBusError</span></a> enumeration.  See
<a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> for more information on error domains.
</p>
<p>
Note that errors in this error domain is intended only for
returning errors from a remote message bus process. Errors
generated locally in-process by e.g. <a class="link" href="GDBusConnection.html" title="GDBusConnection"><span class="type">GDBusConnection</span></a> is from the
<a class="link" href="gio-GIOError.html#G-IO-ERROR:CAPS" title="G_IO_ERROR"><code class="literal">G_IO_ERROR</code></a> domain.
</p>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="g-dbus-error-is-remote-error"></a><h3>g_dbus_error_is_remote_error ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_dbus_error_is_remote_error        (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);</pre>
<p>
Checks if <em class="parameter"><code>error</code></em> represents an error received via D-Bus from a remote peer. If so,
use <a class="link" href="GDBusError.html#g-dbus-error-get-remote-error" title="g_dbus_error_get_remote_error ()"><code class="function">g_dbus_error_get_remote_error()</code></a> to get the name of the error.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>A <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if <em class="parameter"><code>error</code></em> represents an error from a remote peer,
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="g-dbus-error-get-remote-error"></a><h3>g_dbus_error_get_remote_error ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *             g_dbus_error_get_remote_error       (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);</pre>
<p>
Gets the D-Bus error name used for <em class="parameter"><code>error</code></em>, if any.
</p>
<p>
This function is guaranteed to return a D-Bus error name for all
<a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>s returned from functions handling remote method
calls (e.g. <a class="link" href="GDBusConnection.html#g-dbus-connection-call-finish" title="g_dbus_connection_call_finish ()"><code class="function">g_dbus_connection_call_finish()</code></a>) unless
<a class="link" href="GDBusError.html#g-dbus-error-strip-remote-error" title="g_dbus_error_strip_remote_error ()"><code class="function">g_dbus_error_strip_remote_error()</code></a> has been used on <em class="parameter"><code>error</code></em>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>A <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>An allocated string or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a> if the D-Bus error name could not be found. Free with <a href="http://library.gnome.org/devel/glib/unstable/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="g-dbus-error-strip-remote-error"></a><h3>g_dbus_error_strip_remote_error ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_dbus_error_strip_remote_error     (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);</pre>
<p>
Looks for extra information in the error message used to recover
the D-Bus error name and strips it if found. If stripped, the
message field in <em class="parameter"><code>error</code></em> will correspond exactly to what was
received on the wire.
</p>
<p>
This is typically used when presenting errors to the end user.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>A <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if information was stripped, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> otherwise.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="GDBusErrorEntry"></a><h3>GDBusErrorEntry</h3>
<pre class="programlisting">typedef struct {
  gint         error_code;
  const gchar *dbus_error_name;
} GDBusErrorEntry;
</pre>
<p>
Struct used in <a class="link" href="GDBusError.html#g-dbus-error-register-error-domain" title="g_dbus_error_register_error_domain ()"><code class="function">g_dbus_error_register_error_domain()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> <em class="structfield"><code><a name="GDBusErrorEntry.error-code"></a>error_code</code></em>;</span></p></td>
<td>An error code.</td>
</tr>
<tr>
<td><p><span class="term">const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *<em class="structfield"><code><a name="GDBusErrorEntry.dbus-error-name"></a>dbus_error_name</code></em>;</span></p></td>
<td>The D-Bus error name to associate with <em class="parameter"><code>error_code</code></em>.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="g-dbus-error-register-error-domain"></a><h3>g_dbus_error_register_error_domain ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_dbus_error_register_error_domain  (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *error_domain_quark_name</code></em>,
                                                         <em class="parameter"><code>volatile <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gsize"><span class="type">gsize</span></a> *quark_volatile</code></em>,
                                                         <em class="parameter"><code>const <a class="link" href="GDBusError.html#GDBusErrorEntry" title="GDBusErrorEntry"><span class="type">GDBusErrorEntry</span></a> *entries</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#guint"><span class="type">guint</span></a> num_entries</code></em>);</pre>
<p>
Helper function for associating a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> error domain with D-Bus error names.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>error_domain_quark_name</code></em> :</span></p></td>
<td>The error domain name.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>quark_volatile</code></em> :</span></p></td>
<td>A pointer where to store the <a href="http://library.gnome.org/devel/glib/unstable/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>entries</code></em> :</span></p></td>
<td>A pointer to <em class="parameter"><code>num_entries</code></em> <a class="link" href="GDBusError.html#GDBusErrorEntry" title="GDBusErrorEntry"><span class="type">GDBusErrorEntry</span></a> struct items.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>num_entries</code></em> :</span></p></td>
<td>Number of items to register.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="g-dbus-error-register-error"></a><h3>g_dbus_error_register_error ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_dbus_error_register_error         (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> error_domain</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> error_code</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dbus_error_name</code></em>);</pre>
<p>
Creates an association to map between <em class="parameter"><code>dbus_error_name</code></em> and
<a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>s specified by <em class="parameter"><code>error_domain</code></em> and <em class="parameter"><code>error_code</code></em>.
</p>
<p>
This is typically done in the routine that returns the <a href="http://library.gnome.org/devel/glib/unstable/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> for
an error domain.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>error_domain</code></em> :</span></p></td>
<td>A <a href="http://library.gnome.org/devel/glib/unstable/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> for a error domain.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error_code</code></em> :</span></p></td>
<td>An error code.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dbus_error_name</code></em> :</span></p></td>
<td>A D-Bus error name.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the association was created, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if it already
exists.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="g-dbus-error-unregister-error"></a><h3>g_dbus_error_unregister_error ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gboolean"><span class="returnvalue">gboolean</span></a>            g_dbus_error_unregister_error       (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> error_domain</code></em>,
                                                         <em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> error_code</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dbus_error_name</code></em>);</pre>
<p>
Destroys an association previously set up with <a class="link" href="GDBusError.html#g-dbus-error-register-error" title="g_dbus_error_register_error ()"><code class="function">g_dbus_error_register_error()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>error_domain</code></em> :</span></p></td>
<td>A <a href="http://library.gnome.org/devel/glib/unstable/glib-Quarks.html#GQuark"><span class="type">GQuark</span></a> for a error domain.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>error_code</code></em> :</span></p></td>
<td>An error code.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dbus_error_name</code></em> :</span></p></td>
<td>A D-Bus error name.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>
<a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#TRUE:CAPS"><code class="literal">TRUE</code></a> if the association was destroyed, <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#FALSE:CAPS"><code class="literal">FALSE</code></a> if it wasn't found.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="g-dbus-error-new-for-dbus-error"></a><h3>g_dbus_error_new_for_dbus_error ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="returnvalue">GError</span></a> *            g_dbus_error_new_for_dbus_error     (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dbus_error_name</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dbus_error_message</code></em>);</pre>
<p>
Creates a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> based on the contents of <em class="parameter"><code>dbus_error_name</code></em> and
<em class="parameter"><code>dbus_error_message</code></em>.
</p>
<p>
Errors registered with <a class="link" href="GDBusError.html#g-dbus-error-register-error" title="g_dbus_error_register_error ()"><code class="function">g_dbus_error_register_error()</code></a> will be looked
up using <em class="parameter"><code>dbus_error_name</code></em> and if a match is found, the error domain
and code is used. Applications can use <a class="link" href="GDBusError.html#g-dbus-error-get-remote-error" title="g_dbus_error_get_remote_error ()"><code class="function">g_dbus_error_get_remote_error()</code></a>
to recover <em class="parameter"><code>dbus_error_name</code></em>.
</p>
<p>
If a match against a registered error is not found and the D-Bus
error name is in a form as returned by <a class="link" href="GDBusError.html#g-dbus-error-encode-gerror" title="g_dbus_error_encode_gerror ()"><code class="function">g_dbus_error_encode_gerror()</code></a>
the error domain and code encoded in the name is used to
create the <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>. Also, <em class="parameter"><code>dbus_error_name</code></em> is added to the error message
such that it can be recovered with <a class="link" href="GDBusError.html#g-dbus-error-get-remote-error" title="g_dbus_error_get_remote_error ()"><code class="function">g_dbus_error_get_remote_error()</code></a>.
</p>
<p>
Otherwise, a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> with the error code <a class="link" href="gio-GIOError.html#G-IO-ERROR-DBUS-ERROR:CAPS"><code class="literal">G_IO_ERROR_DBUS_ERROR</code></a>
in the <a class="link" href="gio-GIOError.html#G-IO-ERROR:CAPS" title="G_IO_ERROR"><span class="type">G_IO_ERROR</span></a> error domain is returned. Also, <em class="parameter"><code>dbus_error_name</code></em> is
added to the error message such that it can be recovered with
<a class="link" href="GDBusError.html#g-dbus-error-get-remote-error" title="g_dbus_error_get_remote_error ()"><code class="function">g_dbus_error_get_remote_error()</code></a>.
</p>
<p>
In all three cases, <em class="parameter"><code>dbus_error_name</code></em> can always be recovered from the
returned <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> using the <a class="link" href="GDBusError.html#g-dbus-error-get-remote-error" title="g_dbus_error_get_remote_error ()"><code class="function">g_dbus_error_get_remote_error()</code></a> function
(unless <a class="link" href="GDBusError.html#g-dbus-error-strip-remote-error" title="g_dbus_error_strip_remote_error ()"><code class="function">g_dbus_error_strip_remote_error()</code></a> hasn't been used on the returned error).
</p>
<p>
This function is typically only used in object mappings to prepare
<a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> instances for applications. Regular applications should not use
it.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>dbus_error_name</code></em> :</span></p></td>
<td>D-Bus error name.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dbus_error_message</code></em> :</span></p></td>
<td>D-Bus error message.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>An allocated <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>. Free with <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#g-error-free"><code class="function">g_error_free()</code></a>.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="g-dbus-error-set-dbus-error"></a><h3>g_dbus_error_set_dbus_error ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_dbus_error_set_dbus_error         (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dbus_error_name</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dbus_error_message</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *format</code></em>,
                                                         <em class="parameter"><code>...</code></em>);</pre>
<p>
Does nothing if <em class="parameter"><code>error</code></em> is <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>. Otherwise sets *<em class="parameter"><code>error</code></em> to
a new <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> created with <a class="link" href="GDBusError.html#g-dbus-error-new-for-dbus-error" title="g_dbus_error_new_for_dbus_error ()"><code class="function">g_dbus_error_new_for_dbus_error()</code></a>
with <em class="parameter"><code>dbus_error_message</code></em> prepend with <em class="parameter"><code>format</code></em> (unless <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>).
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>A pointer to a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dbus_error_name</code></em> :</span></p></td>
<td>D-Bus error name.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dbus_error_message</code></em> :</span></p></td>
<td>D-Bus error message.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
<td>printf()-style format to prepend to <em class="parameter"><code>dbus_error_message</code></em> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>...</code></em> :</span></p></td>
<td>Arguments for <em class="parameter"><code>format</code></em>.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="g-dbus-error-set-dbus-error-valist"></a><h3>g_dbus_error_set_dbus_error_valist ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                g_dbus_error_set_dbus_error_valist  (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> **error</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dbus_error_name</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *dbus_error_message</code></em>,
                                                         <em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="type">gchar</span></a> *format</code></em>,
                                                         <em class="parameter"><code><span class="type">va_list</span> var_args</code></em>);</pre>
<p>
Like <a class="link" href="GDBusError.html#g-dbus-error-set-dbus-error" title="g_dbus_error_set_dbus_error ()"><code class="function">g_dbus_error_set_dbus_error()</code></a> but intended for language bindings.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>A pointer to a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dbus_error_name</code></em> :</span></p></td>
<td>D-Bus error name.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>dbus_error_message</code></em> :</span></p></td>
<td>D-Bus error message.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>format</code></em> :</span></p></td>
<td>printf()-style format to prepend to <em class="parameter"><code>dbus_error_message</code></em> or <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>var_args</code></em> :</span></p></td>
<td>Arguments for <em class="parameter"><code>format</code></em>.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
<hr>
<div class="refsect2">
<a name="g-dbus-error-encode-gerror"></a><h3>g_dbus_error_encode_gerror ()</h3>
<pre class="programlisting"><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gchar"><span class="returnvalue">gchar</span></a> *             g_dbus_error_encode_gerror          (<em class="parameter"><code>const <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> *error</code></em>);</pre>
<p>
Creates a D-Bus error name to use for <em class="parameter"><code>error</code></em>. If <em class="parameter"><code>error</code></em> matches
a registered error (cf. <a class="link" href="GDBusError.html#g-dbus-error-register-error" title="g_dbus_error_register_error ()"><code class="function">g_dbus_error_register_error()</code></a>), the corresponding
D-Bus error name will be returned.
</p>
<p>
Otherwise the a name of the form
<code class="literal">org.gtk.GDBus.UnmappedGError.Quark._ESCAPED_QUARK_NAME.Code_ERROR_CODE</code>
will be used. This allows other GDBus applications to map the error
on the wire back to a <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> using <a class="link" href="GDBusError.html#g-dbus-error-new-for-dbus-error" title="g_dbus_error_new_for_dbus_error ()"><code class="function">g_dbus_error_new_for_dbus_error()</code></a>.
</p>
<p>
This function is typically only used in object mappings to put a
<a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a> on the wire. Regular applications should not use it.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>error</code></em> :</span></p></td>
<td>A <a href="http://library.gnome.org/devel/glib/unstable/glib-Error-Reporting.html#GError"><span class="type">GError</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>A D-Bus error name (never <a href="http://library.gnome.org/devel/glib/unstable/glib-Standard-Macros.html#NULL:CAPS"><code class="literal">NULL</code></a>). Free with <a href="http://library.gnome.org/devel/glib/unstable/glib-Memory-Allocation.html#g-free"><code class="function">g_free()</code></a>.</td>
</tr>
</tbody>
</table></div>
<p class="since">Since 2.26</p>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.17</div>
</body>
</html>